package myPack;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.TreeMap;


public class ListBuilder {
	
	public ArrayList<File> list;
	
	public ListBuilder() {
		list = new ArrayList<File>();
	}
	
	public void createList(File path) {
		for (String filename: path.list()) {
			File file = new File(filename);
			if (file.isDirectory()) {
				createList(file);
			} else {
				list.add(file);
			}
		}
	}
	
	public void createDB() {
		
	}
	
	public void getBands() {
		HashMap<String, Integer> hashMap = new HashMap<>();
		for (File file: list) {
			String cleared = file.getName().replace('_', ' ');
			String[] cl_list = cleared.split(" ");
			for (String item: cl_list) {
				int new_value = 1;
				if (hashMap.get(item) != null) {
					new_value = hashMap.get(item) + 1;
				}
				hashMap.put(item, new_value);
			}
		}
		TreeMap<String, Integer> sorted_map = new TreeMap<>();
		sorted_map.putAll(hashMap);
		
	}

}
